import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import Layout from '../components/Layout/index.vue';

// 定义路由
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    component: Layout,
    redirect: '/finance',
    children: [
      {
        path: 'schedule',
        name: 'Schedule',
        component: () => import('../pages/schedule/index.vue')
      },
      {
        path: 'statistics',
        name: 'Statistics',
        component: () => import('../pages/statistics/index.vue')
      },
      {
        path: 'travel',
        name: 'Travel',
        component: () => import('../pages/travel/index.vue')
      },
      {
        path: 'finance',
        name: 'Finance',
        component: () => import('../pages/finance/index.vue')
      }
    ]
  }
];

// 创建路由实例
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL || '/'),
  routes
});

export default router; 